//创建webfunnyEvent
window.webfunnyEvent = function(pointId) {
	if (window._webfunnyEvent) {
		if (Object.prototype.hasOwnProperty.call(window._webfunnyEvent, pointId)) {
			return window._webfunnyEvent[pointId];
		} else {
			console.log('【' + pointId + '】点位ID不存在！');
			return {
				trackEvent: () => {}
			};
		}
	} else {
		console.log('SDK异常，请检查！');
		return {
			trackEvent: () => {}
		};
	}
};

//封装打点函数
export function trackWebfunnyEvent(pointId) {
	if (window.webfunnyEvent) {
		return window.webfunnyEvent(pointId).trackEvent({
			uid: localStorage.getItem('uid') || 'unknown',
			behaviorType: 'string',
		}, {
			upNow: true
		});
	} else {
		console.log('SDK异常，请检查！');
	}
}